load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "process",
    srcs = [
        "mem_queue_processor.go",
        "processor.go",
        "processor_utils.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/obsservice/obslib/process",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/obsservice/obslib",
        "//pkg/obsservice/obslib/queue",
        "//pkg/obsservice/obslib/validate",
        "//pkg/util/log",
        "//pkg/util/stop",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_jackc_pgx_v5//pgxpool",
        "@com_github_jackc_pgx_v5//stdlib",
    ],
)

go_test(
    name = "process_test",
    srcs = [
        "mem_queue_processor_test.go",
        "processor_test.go",
    ],
    embed = [":process"],
    deps = [
        "//pkg/obsservice/obslib/queue",
        "//pkg/obsservice/obslib/validate",
        "//pkg/testutils",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
